<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Administration - Kammerath Network</title>
 <link rel="stylesheet" href="/themes/admin/css/admin.css" />
 </head>
 <body>
 <div id="adminUi">
	<div id="adminToolbar">
		{if $view=="article" || $view=="category" || $view=="image"}
		<div id="adminToolbarNew">
			{if $view == "article"}
				<a href="?view=article&action=new">Neuen Artikel erstellen</a>
			{/if}
			{if $view == "category"}
				<a href="?view=category&action=new">Neue Kategorie anlegen</a>
			{/if}
			{if $view == "image"}
				<a href="?view=image&action=new">Bild hochladen</a>
			{/if}
		</div>
		{/if}
		{if $view=="configuration"}
			<div id="adminToolbarSettingSave">
				<a href="#" onclick="javascript:saveConfiguration();">Konfiguration speichern</a>
			</div>
		{/if}
	
		<div id="adminToolbarConfiguration">
			<a href="?view=configuration">Konfiguration</a>
		</div>
		<div id="adminToolbarImage">
			<a href="?view=image">Bilder</a>
		</div>
		<div id="adminToolbarCategory">
			<a href="?view=category">Kategorien</a>
		</div>
		<div id="adminToolbarArticle">
			<a href="?view=article">Artikel</a>
		</div>
		
		<div id="adminToolbarTitle">Administration</div>
		
		
		<div style="clear:both;"></div>
	</div>
	{if $view=="image"}
		{include file="../themes/admin/images.tpl"}
	{/if}
	{if $view=="configuration"}
		{include file="../themes/admin/setting_list.tpl"}
	{/if}
	{if $view=="article" || $view=="category"}
		<div id="adminList">
			{if $view == "article"}
				{if $article_list|@count > 0}
					{include file="../themes/admin/article_list.tpl"}
				{else}
					Es sind keine Artikel in der Datenbank vorhanden.
				{/if}
			{/if}
			{if $view == "category"}
				{if $category_list|@count > 0}
					{include file="../themes/admin/category_list.tpl"}
				{else}
					Es sind keine Kategorien in der Datenbank vorhanden.
				{/if}
			{/if}
		</div>
		{include file="../themes/admin/editor.tpl"}
	{/if}
 </div>
 	<script type="text/javascript" src="/js/tinymce/tiny_mce.js"></script>
	<script type="text/javascript">
	var view = "{$view}";
	var action = "{$action}";
	{if $view=="edit"}
	var item = "{$item_name}";
	{/if}
		
	{literal}
	tinyMCE.init({
	        // General options
	        mode : "textareas",
	        theme : "advanced",
	        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	
	        // Theme options
	        theme_advanced_buttons1 : "save,|,formatselect,fontsizeselect,|,undo,redo,|,bold,italic,underline,strikethrough,|,cut,copy,paste,pastetext,pasteword,search,replace,|,bullist,numlist",
			theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,anchor,image,cleanup,code,|,outdent,indent,blockquote,forecolor,backcolor,|,charmap,emotions,iespell,media,advhr,|,print",
	        theme_advanced_buttons3 : "insertdate,inserttime,preview,|,forecolor,backcolor,|,tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,ltr,rtl",
	        theme_advanced_buttons4 : "",
	        theme_advanced_toolbar_location : "top",
	        theme_advanced_toolbar_align : "left",
	        theme_advanced_statusbar_location : "bottom",
	        theme_advanced_resizing : false,

	        content_css: "/themes/admin/css/editor.css",
	
	        // Skin options
	        skin : "o2k7",
	        skin_variant : "silver",
	});

	function deleteItem(name,view,item){
		var result = confirm("Soll '"+name+"' wirklich unwiederbringlich gelöscht werden?");
		if(result==true){
			location.href='?view='+view+'&item='+item+'&action=delete';
		};
	}

	/* allows to delete images */
	function deleteImage(imageFilename){
		var result = confirm("Soll das folgende Bild wirklich unwiederbringlich gelöscht werden?\n\n"
								+ imageFilename);
		if(result==true){
			location.href='?view=image&item='+imageFilename+'&action=delete';
		};	
	}

	/* asks if the user really wants to overwrite the existing config */
	function saveConfiguration(){
		var result = confirm("Soll die bestehende Konfiguration überschrieben werden?");
		if(result==true){
			document.forms.settingform.submit();
		};	
	}
	
	{/literal}
	</script>
 
 </body>
</html>